package com.rogue.common.core.exception;

import lombok.Getter;

/**
 * 基础异常类
 * @author Yeah
 * @create 2022/03/16
 */
@Getter
public class BaseException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    /**
     * 错误码
     */
    private String code;

    /**
     * 错误码对应的参数
     */
    private Object[] args;

    /**
     * 错误消息
     */
    private String defaultMessage;

    public BaseException(String code, Object[] args, String defaultMessage)
    {
        this.code = code;
        this.args = args;
        this.defaultMessage = defaultMessage;
    }


    public BaseException(String code, Object[] args)
    {
        this(code, args, null);
    }

    public BaseException(String defaultMessage)
    {
        this(null, null, defaultMessage);
    }

    public BaseException(String code, String defaultMessage)
    {
        this(code, null, defaultMessage);
    }

}